<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:b="http://bootsfaces.net/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>欢迎使用工程项目管理平台</title>
        <meta name="author" content="Shangrila Shell"></meta>
		<h:outputScript library="js" name="md5.js" target="head"/>

        <style type="text/css">
            .form-signin {
                margin: 0 auto;
                max-width: 330px;
                padding: 15px;
            }
        </style>
    	<script type="text/javascript">
	        function md5password() {	        	
	            var password = document.getElementById("input_password"); //Bootsfaces ID加前缀input_	            
	        	password.value = hex_md5(password.value);
	        	//alert(password.value);
	        }
	    </script>    
        
    </h:head>
    <h:body style="padding-top: 60px; background-color: #add;">
        <b:container>
            <h:form id="loginform" styleClass="form-signin" prependId="false">
            	<p:growl id="messages" showDetail="true" />
                <h4 class="form-signin-heading">请输入工号和密码登陆：</h4>
                <b:inputText id="userid" value="#{appShiroValidate.userno}" placeholder="工号" 
                	required="true" requiredMessage="账号必须输入" onfocus="this.select();"
                	validator="#{appShiroValidate.validateUserno}" validatorMessage="账号验证不过" >
                    <f:facet name="prepend">
                        <b:icon name="user" />
                    </f:facet>
                </b:inputText>
                <b:inputText id="password" value="#{appShiroValidate.password}" placeholder="密码" type="password" 
                	onblur="md5password();" onfocus="this.select();" 
                	required="true"  requiredMessage="密码必须输入"
					validator="#{appShiroValidate.validatePassword}" validatorMessage="密码验证不过" >
                    <f:facet name="prepend">
                        <b:iconAwesome name="key" />
                    </f:facet>
                </b:inputText>
                <!-- <b:selectBooleanCheckbox value="true" caption="记住我" />  -->
                <b:commandButton look="primary btn-block" value="登陆" icon="log-in" size="lg"                 	
                	update="messages"  action="#{appShiroValidate.login}" />
            </h:form>
        </b:container>
    </h:body>
</html>